import {
	$http
} from '@escook/request-miniprogram'
uni.$http = $http
//配置请求根路径
$http.baseUrl = 'https://api-hmugo-web.itheima.net'
//请求前做什么
$http.beforeRequest = function(options) {
	wx.showLoading({
		title: '数据加载中...',
	})
}
//请求后做什么
$http.afterRequest = function() {
	//隐藏 loading 效果
	uni.hideLoading()

}
//封装全局提示
uni.$showMsg = function(title = "数据获取失败", duration = 1500) {
	uni.showToast({
		title,
		duration,
		icon: 'none'
	});
}

// #ifndef VUE3
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
